package com.my.test.java.two.moredata.datas.share;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.my.test.java.two.moredata.datas.AbsConnection;
import com.my.test.java.two.moredata.datas.HPreparedstatement;
import com.my.test.java.two.moredata.datas.rule.DataSourceAg;
import com.my.test.java.two.moredata.datas.rule.IDataSourceRule;
import com.my.test.java.two.moredata.datas.rule.ITableRule;
import com.my.test.java.two.moredata.datas.rule.TableRuleAg;
import com.my.test.java.two.moredata.datas.sqlrotu.SQLRotu;

public class ShareConnection extends AbsConnection{

	public Map<String,Connection> map;
	private IDataSourceRule dataSourceRule;
	private TableRuleAg tableRule;
	private DataSourceAg dataSourceAg;
	
	public ShareConnection(){}
	
	public ShareConnection(Map<String,Connection> map){
		this.map = map;
	}
	public ShareConnection(Map<String,Connection> map,TableRuleAg tableRule,DataSourceAg dataSourceAg){
		this.map = map;
		this.tableRule = tableRule;
		this.dataSourceAg = dataSourceAg;
	}
	
	public SharePreparedStatement prepareStatement(String sql) throws SQLException {
		
		return new SharePreparedStatement(tableRule,dataSourceAg,sql,map);
	}
	
}
